package com.runshu.newsmartark.mvp.model;

import com.runshu.newsmartark.common.ConstantUrl;
import com.runshu.newsmartark.entity.InventoryDetailEntity;
import com.runshu.newsmartark.entity.ProDetailEntity;
import com.runshu.newsmartark.entity.ProductsBean;
import com.runshu.newsmartark.mvp.contract.ProDetailContract;
import com.runshu.newsmartark.network.netbean.HttpRequestParamsBuilder;
import com.runshu.newsmartark.network.netbean.ResponseBean;
import com.runshu.newsmartark.network.netinterface.BaseCallBack;

/**
 * Demo class
 *
 * @author yu
 * @date 12/7/20
 * @decs：
 */

public class ProDetailModel extends BaseModel implements ProDetailContract.Model {

    @Override
    public void getProDetail(String manufacturer, String productNo, String model, String stockName, String expiryDate, int pageSize, int pageNum, int type,BaseCallBack baseCallBack) {
        HttpRequestParamsBuilder builder = new HttpRequestParamsBuilder();
        builder.putParams("manufacturer", manufacturer);
        builder.putParams("productNo", productNo);
        builder.putParams("model", model);
        builder.putParams("stockName", stockName);
        builder.putParams("expiryDate", expiryDate);
        builder.putParams("pageSize", pageSize);
        builder.putParams("pageNum", pageNum);
        builder.putParams("type", type);
        super.initDataFromServer(ConstantUrl.GET_PRO_DETAIL, builder.build(), ProDetailEntity.class, ResponseBean.RES_DATATYPE_BEAN, baseCallBack);

    }

    @Override
    public void getInventoryDetail(String customerId, String hospitalId, String goodsId, String hwId, int pageSize, int pageNum,BaseCallBack baseCallBack) {
        HttpRequestParamsBuilder builder = new HttpRequestParamsBuilder();
        builder.putParams("customerId", customerId);
        builder.putParams("hospitalId", hospitalId);
        builder.putParams("goodsId", goodsId);
        builder.putParams("hwId", hwId);
        builder.putParams("pageSize", pageSize);
        builder.putParams("pageNum", pageNum);
        super.initDataFromServer(ConstantUrl.GET_inventoryDetail, builder.build(), InventoryDetailEntity.class, ResponseBean.RES_DATATYPE_BEAN, baseCallBack);

    }
}